abstract class Animal{//被abstract修饰的类称为抽象类
    public String name;
    public int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public abstract void eat();//被abstract修饰的方法称为抽象方法，抽象方法没有具体的实现
}
abstract class Dog extends Animal{

    public Dog(String name, int age) {
        super(name, age);
    }


}
    public class Test {
    public static void main(String[] args) {
        Dog dog=new Dog("旺财",2);//此时子类也不能实例化，因为此时子类也是抽象类
        Animal animal=dog;
        animal.eat();
    }
}
